package game.objects;
import game.Game;
import game.controlling.Controller;
import game.objects.interfaces.Ownable;
import graphics.system.Color;
import physics.Body;
import physics.joints.JAngleJoint;
import physics.joints.JBackgroundAngleJoint;
import physics.joints.JBackgroundDistanceJoint;
import physics.joints.JDistanceJoint;
import physics.shapes.Polygon;
import physics.tools.Initializer;
import tools.Help;
import tools.Point;
import tools.id.IdObject;
import tools.intersectionTests.IntersectionTest;
/**
 * This is probably the dumbest GameObject ever.
 * 
 * @author toni
 * 
 */
public class GOCircle extends GameObject implements Ownable {
	private int ownerId = IdObject.DEFAULTID;
	float r;
	float mass;
	Color color;
	private int colBody = -1;
	private int colGroup = -1;
	public GOCircle(Game g, Point point, float r, float mass, float angle, Color color) {
		super(g, point, angle);
		this.r = r;
		this.mass = mass;
		this.color = color;
	}
	public GOCircle(Game g, Point point, float r, float mass, float angle, Color color, int colBody, int colGroup) {
		super(g, point, angle);
		this.r = r;
		this.mass = mass;
		this.color = color;
		this.colBody = colBody;
		this.colGroup = colGroup;
	}
	@Override
	public void handle() {
	}
	@Override
	public void control(Controller c) {
		if (c.pressedGame("shoot")) {
			Point force = c.getMp().sub(getBody(0).pos).mul(1);
			getBody(0).applyForce(force);
		}
	}
	@Override
	public void initialize(Point pos, float angle) {
		addBodyWithGraphics(Initializer.getCircle(pos, r, mass), color);
	}
	@Override
	public int getOwner() {
		return ownerId;
	}
	@Override
	public void setOwner(int ownerId) {
		this.ownerId = ownerId;
	}
}
